package klimuts.periodicals.catalog;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * Contain all information about an periodical
 * @author Siarhei Klimuts
 */
@Entity
@Table(name="periodicals")
public class Periodical {
	private long id;
	private String name;
	private String description;
	private byte type;
	private float price;
	
	public Periodical() {}
	
	public Periodical(String name, String description, byte type, float price) {
		setName(name);
		setDescription(description);
		setType(type);
		setPrice(price);
	}
	
	public String toString() {
		return name;
	}
	
	@Id
	@GeneratedValue
	public long getId(){
		return id;
	}
	
	public void setId(long id){
		this.id=id;
	}
	
	public String getName(){
		return name;
	}
	
	public void setName(String name){
		this.name=name;
	}
	
	public String getDescription(){
		return description;
	}
	
	public void setDescription(String description){
		this.description=description;
	}
	
	public byte getType(){
		return type;
	}
	
	public void setType(byte type){
		this.type=type;
	}
	
	public float getPrice(){
		return price;
	}
	
	public void setPrice(float price){
		this.price=price;
	}

}
